/**
 * 
 */
package com.ruyipu.forum.base;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import com.ruyipu.forum.R;

/**
 * @author donald
 *
 */
public class Menu {
	
	private Context context;
	private List<MenuItem> menuList;
	private LinearLayout layout;
	private LayoutInflater li;
	
	public Menu(Context context) {
		this.context = context;
		menuList = new ArrayList<MenuItem>();
		layout = new LinearLayout(context);
		String inflater = Context.LAYOUT_INFLATER_SERVICE;
		li = (LayoutInflater) context.getSystemService(inflater);
		li.inflate(R.layout.menu, layout);
	}
	
	public View getMenu() {
		return layout;
	}
	
	public void show() {
		layout.setVisibility(View.VISIBLE);
	}
	
	public void hide() {
		layout.setVisibility(View.GONE);
	}
	
	public void addMenuItem(MenuItem menu) {
		menuList.add(menu);
	}
	
	@SuppressWarnings("unused")
	private void createMenuList() {
		
	}
	
	@SuppressWarnings("unused")
	private View getMenuItem() {
		LinearLayout container = new LinearLayout(context);
		container = (LinearLayout) li.inflate(R.layout.menu_item, container);
		return container;
	}
}
